import request from '@/utils/request'

// crm 检索报价模板
export function crmProductQuotationItems() {
    return request({
        url: 'crmQuotationItem/queryPageList',
        method: 'post'
    })
}

// 下拉选项
export function queryQuotationTemplate() {
    return request({
        url: 'crmQuotationItem/queryQuotationTemplate',
        method: 'post'
    })
}

// 新建或修改报价模版
export function saveOrUpdate(data) {
    return request({
        url: 'crmQuotationItem/saveOrUpdate',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}


// 删除报价模版
export function delQuotationItem(data) {
    return request({
        url: 'crmQuotationItem/del',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}


// =============  报价相关接口  ===============


// 获取报价列表
export function crmQuotationIndex(data) {
    return request({
        url: 'crmQuotationCombination/queryPageList',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

// crm 详情
export function crmQuotationRead(data) {
    return request({
        url: 'crmQuotationCombination/queryById',
        method: 'post',
        data: data
    })
}


// 报价信息中通过部署方式获取报价项
export function crmQuotationQueryDeploy(data) {
    return request({
        url: 'crmQuotationCombination/queryDeploy',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

// 编辑报价信息中每个报价项关联产品列表
export function crmQuotationQueryProductList(data) {
    return request({
        url: 'crmQuotationCombination/queryProductList',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

// 报价信息中通过部署方式获取报价项
export function crmQuotationSave(data) {
    return request({
        url: 'crmQuotationCombination/saveOrUpdate',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

// 报价信息编辑时，获取报价项信息
export function crmQueryMaterialList(data) {
    return request({
        url: 'crmQuotationCombination/queryMaterialList',
        method: 'post',
        data: data
    })
}

// 通过商机ID，获取报价列表
export function queryQuotationsByBusiness(data) {
    return request({
        url: 'crmQuotationCombination/queryByBusinessIdForQuotationList',
        method: 'post',
        data: data
    })
}

// 通过商机ID，删除报价
export function delQuotationByIds(data) {
    return request({
        url: 'crmQuotationCombination/delQuotationByIds',
        method: 'post',
        data: data
    })
}

// 通过部署方式，带出合同标的
export function queryContractSubjectList(data) {
    return request({
        url: 'crmQuotationCombination/queryContractSubjectList',
        method: 'post',
        data: data
    })
}



